package com.wqm.cn.web;

import com.wqm.cn.service.Userservice;
import com.wqm.cn.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    Userservice userservice;

    @RequestMapping("/users")
    public String listUsers(Model model) {
        model.addAttribute("users", queryUsers());
        return "userlist";
    }




    private List<User> queryUsers() {
        return userservice.queryUsers();
    }
}
